<?php

namespace Yz\modules\Users;

class Template_BlockUserInfo
    extends \Yz_Template_Native
    implements \Yz_Template_Interface
{

    protected function doRender()
    {
        $user = \Yz_User_Default::getInstance();
        $val =& $this->value;
        $val['user'] = $user;
        $val['IPAddress'] = \Yz_HTTP_Request::getInstance()->getRemoteAddr();
        $val['username'] = $user->isAuthenticated()
            ? $user->getLogin()
            : $this->translate('Anonymous');
        return parent::doRender();
    }

}
